<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>备注</title>

    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body>
<div id="blank" class="header" >
    <div v-back.tapmode class="back"></div>
    <span class="title">备注</span>
</div>
<div class="top-container" id="app">
    <div class="feedback-textarea">
        <textarea v-model="remark" v-focus></textarea>
    </div>
    <a class="btn-commit" v-myclick="commit">提交</a>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>

    var vm;
    var user;
    apiready = function () {
        setBSImg();
        new Vue({
            el:'#blank'
        });
        user = JSON.parse(getPrefs('user'));
        initApp();
        api.parseTapmode();
        addListeners();
    };

    function initApp() {
        vm = new Vue({
            el:'#app',
            data:{
                remark: user.remark
            },
            methods:{
                commit:function () {
                    showProgress();
                    var data = {
                        member_id:getPrefs('member_id'),
                        remark:this.remark
                    };
                    var callback = function () {
                        api.sendEvent({
                            name: 'updUser',
                            extra: {
                                remark: vm.remark
                            }
                        });
                        closeWin();
                    };
                    pinet.post(URL.updUserInfo, data, callback);
                }
            }
        })
    }

    function addListeners() {
        api.addEventListener({
            name: 'viewappear'
        }, function () {
            onPageStart();
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function (ret, err) {
            onPageEnd();
        });

        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            onPageEnd();
            api.closeWin();
        });
    }

</script>
</html>